gdk/wayland: Don't make gtk_shell1 v2 mandatory
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 19 Sep 2017 16:30:01 +0000 (18:30 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 19 Sep 2017 16:35:20 +0000 (18:35 +0200)
It may result in a protocol error on older mutters, as GTK+ will
invariably request a higher version than what's available. Make
GTK+ also accept v1 if it's all the compositor has got.

gdk/wayland/gdkdisplay-wayland.c

index 30f4d4308adc7629cb1bbe5d5bf3529485c1d1b2..31e19359c6e50b57b49be200918f5786bbedbff2 100644 (file)
@@ -376,7 +376,7 @@ gdk_registry_handle_global (void               *data,
       display_wayland->gtk_shell =
         wl_registry_bind(display_wayland->wl_registry, id,
                          &gtk_shell1_interface,
-                         GTK_SHELL1_VERSION);
+                         MIN (version, GTK_SHELL1_VERSION));
       _gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
       display_wayland->gtk_shell_version = version;
     }